# frozen_string_literal: true

module ApplicationHelper
  def active_controller(params, action)
    params[:controller] == action ? 'active' : ''
  end

  def params_hash(coupon)
    params = {
      name: coupon.name,
      region: coupon.region,
      kind: coupon.kind,
      price: coupon.price,
      state: coupon.state,
      begin_date: coupon.begin_date,
      end_date: coupon.end_date
    }
    params
  end

  def params_item(coupon)
    params = {
      name: coupon.name,
      region: coupon.region,
      kind: coupon.kind,
      price: coupon.price,
      begin_date: coupon.begin_date,
      end_date: coupon.end_date
    }
    params
  end
end
